-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[lldb] Use InlHostByteOrder in RegisterValue::SetValueFromData #169624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb] Use InlHostByteOrder in RegisterValue::SetValueFromData #169624
Conversation
|
@llvm/pr-subscribers-lldb Author: Matej Košík (sedymrak) ChangesAn existing code can be further simplified. Full diff: https://github.com/llvm/llvm-project/pull/169624.diff 1 Files Affected:
diff --git a/lldb/source/Utility/RegisterValue.cpp b/lldb/source/Utility/RegisterValue.cpp
index c28c9e2d4d106..f555529d314e5 100644
--- a/lldb/source/Utility/RegisterValue.cpp
+++ b/lldb/source/Utility/RegisterValue.cpp
@@ -197,8 +197,7 @@ Status RegisterValue::SetValueFromData(const RegisterInfo ®_info,
else {
std::vector<uint8_t> native_endian_src(src_len, 0);
src.ExtractBytes(src_offset, src_len,
- llvm::sys::IsLittleEndianHost ? eByteOrderLittle
- : eByteOrderBig,
+ endian::InlHostByteOrder(),
native_endian_src.data());
llvm::APInt uint = llvm::APInt::getZero(src_len * 8);
llvm::LoadIntFromMemory(uint, native_endian_src.data(), src_len);
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
|
Looks ok but please give this a (slightly) more descriptive title. "[lldb] Use InlHostByteOrder in RegisterValue::SetValueFromData" would be fine. |
|
LGTM. Please let us know if you need one of us to merge this on your behalf. |
Yes, if everything is in order with this pull-request, please merge this on my behalf. Thank you! |
…169624) An existing code can be further simplified. --------- Co-authored-by: Matej Košík <matej.kosik@codasip.com>
…169624) An existing code can be further simplified. --------- Co-authored-by: Matej Košík <matej.kosik@codasip.com>
…169624) An existing code can be further simplified. --------- Co-authored-by: Matej Košík <matej.kosik@codasip.com>
An existing code can be further simplified.